package lucene.server.common.queue.delegate;

import io.protostuff.Input;
import io.protostuff.Output;
import io.protostuff.Pipe;
import io.protostuff.WireFormat;
import io.protostuff.runtime.Delegate;

import java.io.IOException;
import java.sql.Time;

public class SqlTimeDelegate implements Delegate<Time> {
    @Override
    public WireFormat.FieldType getFieldType() {
        return null;
    }

    @Override
    public Time readFrom(Input input) throws IOException {
        long time = input.readInt64();
        return new Time(time);
    }

    @Override
    public void writeTo(Output output, int i, Time time, boolean b) throws IOException {
        output.writeInt64(i, time.getTime(), b);
    }

    @Override
    public void transfer(Pipe pipe, Input input, Output output, int i, boolean b) throws IOException {

    }

    @Override
    public Class<?> typeClass() {
        return Time.class;
    }
}
